from fastapi import APIRouter
from models.models import ConvertRequest, ConvertResponse
from api.convert import convert_webp_to_png

# 创建API路由器
router = APIRouter(prefix="/api/v1", tags=["convert"])

@router.post("/convert", response_model=ConvertResponse)
async def convert_webp(request: ConvertRequest):
    """
    Convert WebP image to PNG format.
    
    - **image_url**: URL of the WebP image to convert
    """
    return await convert_webp_to_png(request)
